#获取本机IP地址
import pathlib
import socket
import sys


def get_local_ip():
    # s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    # s.connect(('8.8.8.8', 80))
    # ip = s.getsockname()[0]
    # s.close()
    ip = socket.gethostbyname(socket.gethostname())
    return ip
print(get_local_ip())

frame = sys._getframe()
current_file = __file__
print(frame.f_code.co_filename)
print(current_file)


try:
    from dotenv import load_dotenv, find_dotenv

    env_ = pathlib.Path(find_dotenv(".env")).parent
    print(env_)
except ImportError:
    print('error')